<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Cross-Origin Request Test</title>
</head>
<body>
<button id="sendRequest">Send Request</button>
<script>
    document.getElementById('sendRequest').addEventListener('click', () => {
        fetch('http://localhost:8080/api/test', {
            method: 'GET',
            headers: {
                'Content-Type': 'application/json'
            }
        })
            .then(response => response.json())
            .then(data => console.log(data))
            .catch(error => console.error('Error:', error));
    });
</script>
</body>
</html>
